<template>
	<view class="content tn-safe-area-inset-bottom box">
		<view>
			<!-- <tn-swiper :list="list"></tn-swiper> -->
			 <image :src="details.cover"></image> 
		</view>
		<view class="tn-padding-sm">
			<view class="tn-b-f tn-padding-sm">
				<view class="item tn-flex tn-text-xl">
					<view>{{details.name||""}}</view>
				</view>
			</view>
		</view>
		<view class="tn-padding-sm">
			<view class="tn-b-f tn-padding-sm">
		
				<view class="item tn-flex tn-text-lg">
					<view>房 屋 规 模:</view>
					<view>{{details.subtitle||""}}</view>
				</view>
				<view class="item tn-flex tn-text-lg">
					<view>面 积:</view>
					<view>{{details.area||""}}㎡</view>
				</view>
				<view class="item tn-flex tn-text-lg">
					<view>月 租:</view>
					<view class="price">{{details.monthlyRent||""}}元/月</view>
				</view>
			</view>
		</view>
		<view class="tn-padding-sm">
			<view class="tn-b-f tn-padding-sm">
				<view class="item tn-flex tn-text-lg">
					<view>
						<text class="tn-icon-my" style="font-size:48rpx"></text>
					</view>
					<view class="tn-margin-left-sm">{{details.contactName||""}}</view>
				</view>
				<view class="item tn-flex tn-text-lg">
					<view>
						<text class="tn-icon-empty-address" style="font-size:48rpx"></text>
					</view>
					<view class="tn-margin-left-sm">{{details.parkName||""}}</view>
				</view>
				<view class="item tn-flex tn-text-lg">
					<text class="tn-icon-phone" style="font-size:48rpx"></text>
					<view class="tn-margin-left-sm">{{details.mobile||""}}</view>
				</view>
			</view>
		</view>
		<view class="tn-padding-sm" v-if="details.detail">
			<view class="tn-b-f tn-padding-sm">
				<view class="item tn-flex">
					<view v-html="details.detail"></view>
				</view>
			</view>
		</view>
		<view class="footerBtn tn-b-f">
			<view class="btn tn-flex tn-flex-row-around tn-flex-col-center">
				<view class="left common-button">
					<view @click="CallPhone">电话咨询</view>
				</view>
				<view class="right common-button">
					<view @click="nav">预约看房</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		GetunleasedHouseById
	} from '@/api/house/index'
	export default {
		data() {
			return {
				details: {},
				id: '',
				list: [],

			}
		},
		onLoad(e) {
			this.id = e.id
		},
		onShow() {
			this.getunleasedHouseById()
		},
		methods: {
			CallPhone() {
				uni.makePhoneCall({
					phoneNumber: this.details.mobile,
				});
			},
			nav() {
				uni.navigateTo({
					url: `/subcontract/house/webView`
				});

			},
			getunleasedHouseById() {
				let obj = {
					id: this.id
				}
				GetunleasedHouseById(obj).then((res) => {
					this.details = res.data
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.box {
		padding-bottom: 200rpx;
	}

	.item {
		line-height: 50rpx;
		font-size: 28rpx;
	}
	.price{
		color:red;
	}
  image{
	  width: 100%;
	  height:400rpx;
  }
	.footerBtn {
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100%;

		.btn {
			height: 100rpx;
			width: 100%;

			.common-button {
				border-radius: 20rpx;
				width: 300rpx;
				height: 80rpx;
				font-size: 36rpx;
				line-height: 80rpx;
				text-align: center;
				color: #fff;
				margin: auto;
			}

			.left {
				background-color: #18dd8b;
			}

			.right {

				background-color: #1634dd;

			}
		}
	}
	.price{
		color:red;
	}
</style>